﻿namespace Stock.Model
{
    public class StockModel
    {
        /// <summary>
        /// 排序字段 值越大 越靠前
        /// </summary>
        public int No { get; set; }

        public string MarketType { get; set; }

        /// <summary>
        /// 1=上证 0=深证
        /// </summary>

        public string MktNum { get; set; }

        /// <summary>
        /// 股票代码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 股票名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 股票当前价格
        /// </summary>
        public double Price { get; set; }

        /// <summary>
        /// 涨幅/跌幅
        /// </summary>
        public double Change { get; set; }

        /// <summary>
        /// 涨幅/跌幅 百分比
        /// </summary>
        public string ChangePercent { get; set; }

        /// <summary>
        /// 1=股票 0=基金
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 持有数量
        /// </summary>
        public double Number { get; set; }

        /// <summary>
        /// 成本价格
        /// </summary>
        public double CostPrice { get; set; }

        public bool IsOTCFund()
        {
            return MktNum == "150";
        }

        public override string ToString()
        {
            return $"[{Code}][{Name}]";
        }
    }
}
